// components/address_multiSelector/address_multiSelector.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    leftValue:{
      type:String
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    multiArray: [['1','2','3','4','5','6','7','8','9','10','11','12'],['月','年']],
    multiIndex: [0, 0],
    leftValue:'',
  },

  /**
   * 组件的方法列表
   */
  methods: {
    bindMultiPickerChange: function (e) {
      console.log('picker发送选择改变，携带值为', e.detail.value)
      this.setData({
        multiIndex: e.detail.value
      })
    },
    bindMultiPickerColumnChange: function (e) {
      console.log('修改的列为', e.detail.column, '，值为', e.detail.value);
      var data = {
        multiArray: this.data.multiArray,
        multiIndex: this.data.multiIndex
      };
      data.multiIndex[e.detail.column] = e.detail.value;
      switch (e.detail.column) {
        case 0:
          data.multiArray[1] = ['月','年'];
          data.multiIndex[1] = 0;
          break;
        case 1:
          data.multiArray[1] = ['月','年'];
          data.multiIndex[2] = 0;
          break;
      }
      console.log(data.multiIndex);
      this.setData(data);
    },
  }
})
